Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite devices dashboard page in react #6489

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

thornbill
Copy link
Member

Changes
Rewrites the devices dashboard page in react using the table pattern

Screenshot 2025-01-30 at 13-18-41 Devices

Issues
N/A

@thornbill thornbill added the enhancement Improve existing functionality or small fixes label Jan 30, 2025
@thornbill thornbill added this to the v10.11.0 milestone Jan 30, 2025
@thornbill thornbill requested a review from a team as a code owner January 30, 2025 18:22
@jellyfin-bot
Copy link
Collaborator

jellyfin-bot commented Jan 30, 2025

Cloudflare Pages deployment

Latest commit f0c1641
Status ✅ Deployed!
Preview URL https://f2718c45.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint doesn't pass. Please fix all ESLint issues.

src/apps/dashboard/routes/devices/index.tsx Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint doesn't pass. Please fix all ESLint issues.

accessorFn: row => parseISO8601Date(row.DateLastActivity),
header: globalize.translate('LabelTime'),
size: 160,
Cell: ({ cell }) => toLocaleString(cell.getValue<Date>()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would toLocaleDateString with getDisplayTime be more readable? (example)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just use standard approaches for displaying the date time... I did switch to using date-fns though since eventually we should replace the custom date formatting stuff.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a personal suggestion, but we could consider removing the seconds part in favor of easier comprehension at a glance.

src/apps/dashboard/routes/devices/index.tsx Outdated Show resolved Hide resolved
...DEFAULT_TABLE_OPTIONS,

columns,
data: devices?.Items || [],
Copy link
Member

@viown viown Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you are tabbed out for a while and come back to the page or when deleting/editing a device, react query will re-render the data causing the table state (current page, filters, etc) to reset.

We might be able to fix this by adding autoResetPageIndex: isRefetching (have not tried).

This likely affects other tables as well.

Comment on lines -183 to -195
// Enable custom features
enableColumnPinning: true,
enableColumnResizing: true,

// Sticky header/footer
enableStickyFooter: true,
enableStickyHeader: true,
muiTableContainerProps: {
sx: {
maxHeight: 'calc(100% - 7rem)' // 2 x 3.5rem for header and footer
}
},

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this refactor for the api keys page as well? 😅

I'm also alright with doing it in another PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It didn't exist when I started this and I didn't want to make the PR bigger. 😅

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint doesn't pass. Please fix all ESLint issues.

src/apps/dashboard/routes/devices/index.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve existing functionality or small fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants